package com.example.mylogin.controller;

import com.example.mylogin.entity.Person;
import com.example.mylogin.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 功能描述：
 * </p>
 *
 * @author cui haida
 * @date 2025/06/05/22:25
 */
@RestController
@RequestMapping("/person")
public class PersonController {


    private final UserService userService;

    public PersonController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping("/get1")
    public String get1() {
        List<Person> userByCondition = userService.getUserByCondition();
        return userByCondition.toString();
    }

    @GetMapping("/get2")
    public String get2() {
        return userService.getUserByCondition2().toString();
    }

    @GetMapping("/get3")
    public String get3() {
        return userService.getUserByCondition3().toString();
    }

    @GetMapping("/get4")
    public String get4() {
        return userService.getUserByCondition4().toString();
    }
}

